package service

import (
	"context"
	"monoblog/common/register"
	"monoblog/domain/dto"
	"monoblog/domain/model"
)

func GetSectionService() SectionService {
	return register.GetInstance[SectionService]("SectionService")
}

type SectionService interface {
	// Add 添加专栏
	Add(ctx context.Context, form dto.SectionReqForm) (string, error)

	// UpdateByID 更新专栏
	UpdateByID(ctx context.Context, id string, form dto.SectionReqForm) error

	// DeleteByID 删除专栏
	DeleteByID(ctx context.Context, id string) error

	FindByID(ctx context.Context, id string) (*model.Section, error)

	// FindList 查询所有专栏
	FindList(ctx context.Context) ([]*model.Section, error)

	// SectionsByUserId 查询用户下的专栏list
	SectionsByUserId(ctx context.Context, userId string) ([]*model.Section, error)
}
